package com.test.foundary;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Snippet {
	public static void main(String[] args) throws ParseException, Exception {
		System.out.println("----------"+System.getProperty("user.dir"));
		//statisticsTime%3D2020-01-13+16%3A00%252CstatisticsType%253Dminute&RespFields=&
		
		String params = "statisticsTime%3D2020-01-14+20%3A00%3A00%2CoriginArea%3D%22%22%2CdestinationArea%3D%22%22&";
		String params1 = "statisticsTime%3D2020-01-14+20%3A50%3A00%2CstatisticsType%3D%22minute%22&";
		String params2 = "statisticsTime%3D%222020-01-14+16%3A15%3A00%22&RespFields=&";
		String str = URLDecoder.decode((URLDecoder.decode(params,"UTF-8")),"UTF-8");
        //statisticsTime=2020-01-13 16:00,statisticsType=minute&RespFields=&
        int index = str.lastIndexOf("statisticsTime");
        String statisticsT = str.substring(index+1,34).split("=")[1];
        System.out.println("--1--"+statisticsT);
		String str1 = str.substring(0, 38);
		 String keyWord = URLDecoder.decode("%C4%E3%BA%C3", "GBK");    
		String str3 = URLDecoder.decode((URLDecoder.decode(params,"UTF-8")),"UTF-8");
		String str31 = URLDecoder.decode((URLDecoder.decode(params1,"UTF-8")),"UTF-8");
		String str32 = URLDecoder.decode((URLDecoder.decode(params2,"UTF-8")),"UTF-8");
		System.out.println("---"+str3);
		System.out.println("---"+str31);
		System.out.println("---"+str32);
		String[] str2 = str1.split("%3D");
		DateFormat fileDf = new SimpleDateFormat("yyyyMMddHHmm00");//1
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//		System.out.println("----"+statisticsT);
		System.out.println("----"+fileDf.format(simpleDateFormat.parse(statisticsT+":00")));
		
		
		
	}
}

